package com.xbsg.protocol.xf.server.netty;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MyServer implements CommandLineRunner{

    @Value("${server.tcp.port}")
    private int port;

    @Autowired
    private MyNettyServer nettyServer;

    @Override
    public void run(String... args) throws Exception {
        nettyServer.start(port);
    }

}
